<?php
header ("Content-Type:text/html; charset= utf-8");

if(empty($_GET['keyword'])){
	echo "forbidden";
	exit();
}
require_once ('config.php');
require_once (WEBSITEURL.'/'.ADMINLOC.'/search_templates.php');
require_once (WEBSITEURL.'/'.ADMINLOC.'/channel_list_templates.php');
$keyword=$_GET['keyword'];
$offset=0;
if(isset($_GET['offset'])){
	$offset=$_GET['offset'];
}
$sys_style_get=new getSysInformation();
$sys_style=$sys_style_get->getSysStyle();
$search_model=basename($sys_style_get->getSearchModel());
if($search_model==""||(!file_exists(WEBSITEURL."/templates/$sys_style/search/$search_model"))){
	$search_model="default.htm";
};
$smarty->template_dir=WEBSITEURL."/templates/$sys_style/search";
$smarty->assign("template_dir","templates/$sys_style");
$smarty->assign("keyword",$keyword);
$smarty->assign("offset",$offset);
$smarty->registerPlugin("block","channellist","channellist"); //注册block
$smarty->registerPlugin("block","searchlist","searchlist"); //注册block
$smarty->display($search_model,md5("search".$search_model));
